﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XiaLastorm.Sharpshooter
{
	/// <summary>
	/// 日志
	/// </summary>
	public class Log
	{
		/// <summary>
		/// 记录时间
		/// </summary>
		public DateTime Time { get; set; }
		/// <summary>
		/// 日志内容
		/// </summary>
		public string Content { get; set; }

		/// <summary>
		/// 生成 <see cref="Log"/> class 的新实例。
		/// </summary>
		/// <param name="time">记录时间</param>
		/// <param name="content">日志内容</param>
		public Log(DateTime time, string content)
		{
			if (time == null)
				throw new ArgumentNullException("time");
			if (content == null)
				throw new ArgumentNullException("content");
			Time = time;
			Content = content;
		}

		/// <summary>
		/// 生成 <see cref="Log"/> class 的新实例。
		/// </summary>
		/// <param name="content">日志内容</param>
		public Log(string content)
			: this(DateTime.Now, content)
		{ }

		public override string ToString()
		{
			return string.Format("{0} : {1}", Time, Content);
		}
	}
}
